/*
 * Account.java
 * 
 * Created on 19-jun-2007, 20:51:27
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.i2a.peacsy.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Tortuga
 */
@Entity
@Table(name = "TA_ACCO_ACCOUNTS")
@NamedQueries({@NamedQuery(name = "Account.findByAccoCoCode", query = "SELECT a FROM Account a WHERE a.accoCoCode = :accoCoCode"), @NamedQuery(name = "Account.findByAccoLiDescription", query = "SELECT a FROM Account a WHERE a.accoLiDescription = :accoLiDescription"), @NamedQuery(name = "Account.findByAccoDaAccountDate", query = "SELECT a FROM Account a WHERE a.accoDaAccountDate = :accoDaAccountDate"), @NamedQuery(name = "Account.findByAccoInState", query = "SELECT a FROM Account a WHERE a.accoInState = :accoInState"), @NamedQuery(name = "Account.findByAudiInSituation", query = "SELECT a FROM Account a WHERE a.audiInSituation = :audiInSituation"), @NamedQuery(name = "Account.findByAudiDaCreationDate", query = "SELECT a FROM Account a WHERE a.audiDaCreationDate = :audiDaCreationDate"), @NamedQuery(name = "Account.findByAudiLiCreationUsr", query = "SELECT a FROM Account a WHERE a.audiLiCreationUsr = :audiLiCreationUsr"), @NamedQuery(name = "Account.findByAudiDaUpdateDate", query = "SELECT a FROM Account a WHERE a.audiDaUpdateDate = :audiDaUpdateDate"), @NamedQuery(name = "Account.findByAudiLiUpdateUsr", query = "SELECT a FROM Account a WHERE a.audiLiUpdateUsr = :audiLiUpdateUsr")})
public class Account implements Serializable {

  @Id
  @Column(name = "ACCO_CO_CODE", nullable = false)
  private Integer accoCoCode;

  @Column(name = "ACCO_LI_DESCRIPTION")
  private String accoLiDescription;

  @Column(name = "ACCO_DA_ACCOUNT_DATE")
  @Temporal(TemporalType.DATE)
  private Date accoDaAccountDate;

  @Column(name = "ACCO_IN_STATE")
  private Short accoInState;

  @Column(name = "AUDI_IN_SITUATION")
  private Short audiInSituation;

  @Column(name = "AUDI_DA_CREATION_DATE")
  @Temporal(TemporalType.TIMESTAMP)
  private Date audiDaCreationDate;

  @Column(name = "AUDI_LI_CREATION_USR")
  private String audiLiCreationUsr;

  @Column(name = "AUDI_DA_UPDATE_DATE")
  @Temporal(TemporalType.TIMESTAMP)
  private Date audiDaUpdateDate;

  @Column(name = "AUDI_LI_UPDATE_USR")
  private String audiLiUpdateUsr;
    protected static org.apache.commons.logging.Log
        log = org.apache.commons.logging.LogFactory.getLog(Account.class);

    public Account() {
    }

  public Account(Integer accoCoCode) {
    this.accoCoCode = accoCoCode;
  }

  public Integer getAccoCoCode() {
    return accoCoCode;
  }

  public void setAccoCoCode(Integer accoCoCode) {
    this.accoCoCode = accoCoCode;
  }

  public String getAccoLiDescription() {
    return accoLiDescription;
  }

  public void setAccoLiDescription(String accoLiDescription) {
    this.accoLiDescription = accoLiDescription;
  }

  public Date getAccoDaAccountDate() {
    return accoDaAccountDate;
  }

  public void setAccoDaAccountDate(Date accoDaAccountDate) {
    this.accoDaAccountDate = accoDaAccountDate;
  }

  public Short getAccoInState() {
    return accoInState;
  }

  public void setAccoInState(Short accoInState) {
    this.accoInState = accoInState;
  }

  public Short getAudiInSituation() {
    return audiInSituation;
  }

  public void setAudiInSituation(Short audiInSituation) {
    this.audiInSituation = audiInSituation;
  }

  public Date getAudiDaCreationDate() {
    return audiDaCreationDate;
  }

  public void setAudiDaCreationDate(Date audiDaCreationDate) {
    this.audiDaCreationDate = audiDaCreationDate;
  }

  public String getAudiLiCreationUsr() {
    return audiLiCreationUsr;
  }

  public void setAudiLiCreationUsr(String audiLiCreationUsr) {
    this.audiLiCreationUsr = audiLiCreationUsr;
  }

  public Date getAudiDaUpdateDate() {
    return audiDaUpdateDate;
  }

  public void setAudiDaUpdateDate(Date audiDaUpdateDate) {
    this.audiDaUpdateDate = audiDaUpdateDate;
  }

  public String getAudiLiUpdateUsr() {
    return audiLiUpdateUsr;
  }

  public void setAudiLiUpdateUsr(String audiLiUpdateUsr) {
    this.audiLiUpdateUsr = audiLiUpdateUsr;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (accoCoCode != null ? accoCoCode.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof Account)) {
      return false;
    }
    Account other = (Account) object;
    if (this.accoCoCode != other.accoCoCode && (this.accoCoCode == null || !this.accoCoCode.equals(other.accoCoCode))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "org.i2a.peacsy.entity.Account[accoCoCode=" + accoCoCode + "]";
  }

}
